/**weightsLib.js v.0.0.2******************************************
 *Author: basanas
 *****************************************************************/
$.ajaxSetup({ cache: false });

function toggleSelect(index)
{
    if (document.getElementById('best' + index).selectedIndex == 2)
        document.getElementById('close_to' + index).style.visibility = 'visible';
    else
        document.getElementById('close_to' + index).style.visibility = 'hidden';
}

function prepareWeights(argCount, argEntities, id)
{
    var weights = new Array();

    for (var i = 0; i < argCount; i++)
        weights.push($("#slider" + i).slider("value"));

    document.submitWeights.weights.value = weights;
    document.submitWeights.entity_ids.value = argEntities;
	document.submitWeights.id.value = id;
    document.submitWeights.submit();
}